package com.heima.user.controller.v1;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.heima.model.user.pojos.ApUserFan;
import com.heima.user.mapper.ApUserFanMapper;
import com.heima.user.mapper.ApUserFollowMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/user_fan")
public class ApUserFanController {

    @Autowired
    ApUserFanMapper apUserFanMapper;

    @GetMapping("/getUserFan")
    public ApUserFan getUserFan(@RequestParam("authorUserID")Integer authorUserID,@RequestParam("loginUserID")Long loginUserID){
        return apUserFanMapper.selectOne(Wrappers.<ApUserFan>lambdaQuery()
        .eq(ApUserFan::getUserId,authorUserID)
        .eq(ApUserFan::getFansId,loginUserID));
    }


}
